/**
 * @param {number[]} nums
 * @return {number}
 */
var lengthOfLIS = function(nums) {
  const dp = new Array(nums.length).fill(1);
  for(let i = 1; i < nums.length; i++) {
    for(let j = 0; j <= i; j++) {
      if(nums[j] < nums[i]) {
        dp[i] = Math.max(dp[j] + 1, dp[i]);
      }
    }
  }
  return Math.max(...dp);
};
let nums = [10,9,2,5,3,7,101,18];
console.log(lengthOfLIS(nums));
nums = [0,1,0,3,2,3];
console.log(lengthOfLIS(nums));
nums = [7,7,7,7,7,7,7];
console.log(lengthOfLIS(nums));
nums = [1,3,6,7,9,4,10,5,6];
console.log(lengthOfLIS(nums));
